package com.heng.service.Impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.heng.dao.entity.coupon.CouponTaskDO;
import com.heng.dao.mapper.CouponTaskMapper;
import com.heng.service.CouponTaskService;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class CouponTaskServiceImpl extends ServiceImpl<CouponTaskMapper, CouponTaskDO> implements CouponTaskService {

    @Override
    public List<CouponTaskDO> getByShopNumber(Long shopNumber) {
        return baseMapper.selectByShopNumber(shopNumber);
    }

    @Override
    public List<CouponTaskDO> getByStatus(Integer status) {
        return baseMapper.selectByStatus(status);
    }

    @Override
    public List<CouponTaskDO> getByTemplateId(Long couponTemplateId) {
        return baseMapper.selectByTemplateId(couponTemplateId);
    }

    @Override
    public IPage<CouponTaskDO> pageQuery(Integer pageNum, Integer pageSize) {
        return baseMapper.selectPage(new Page<>(pageNum, pageSize), null);
    }
}